package com.jyniubi.sms.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
@ConfigurationProperties(prefix = "aliyun.sms")
@Data
public class SmsProperties {
    String host;
    String path;
    String method;
    String appcode;
    String templateId;

    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String APPCODE;
    public static String TEMPLATEID;

    @PostConstruct
    private void init(){
        SmsProperties.HOST = this.host;
        SmsProperties.PATH = this.path;
        SmsProperties.METHOD = this.method;
        SmsProperties.APPCODE = this.appcode;
        SmsProperties.TEMPLATEID = this.templateId;
    }
}
